From: Giovanni Campagna Date: Mon, 13 Jan 2014 22:02:06 +0000 (+0100) Subject: AppDisplay: fix isTerminal() check for apps without categories X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2930 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a4e019442f8613c45839cdf13117539b08b381ad;p=gnome-shell.git AppDisplay: fix isTerminal() check for apps without categories If there is no Categories line in the .desktop file, get_categories() returns null, not an empty array. --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 049b339ff..2f5465b66 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -48,7 +48,8 @@ const PAGE_SWITCH_TRESHOLD = 0.2; const PAGE_SWITCH_TIME = 0.3; function _isTerminal(app) { - return app.get_app_info().get_categories().indexOf('TerminalEmulator') > -1; + let categories = app.get_app_info().get_categories() || []; + return categories.indexOf('TerminalEmulator') > -1; } // Recursively load a GMenuTreeDirectory; we could put this in ShellAppSystem too